package com.lnsf.bookstore.system.log.controller;

import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.common.dto.ResultFailDto;
import com.lnsf.bookstore.common.dto.ResultSuccessDto;
import com.lnsf.bookstore.system.log.service.LogService;
import com.lnsf.bookstore.system.log.vo.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/log")
public class LogController {

	@Autowired
    private LogService logService;

    @RequestMapping("/v_list.do")
    public String list(HttpServletRequest request, ModelMap modelMap){
        System.out.println("log.....");
        return "admin/log/log";
    }

    /**
     *
     * @param params
     * @return
     */
    @RequestMapping("/queryAll")
    @ResponseBody
    public Object queryAll(@RequestParam Map<String, Object> params, Log log) {
        PageInfo<Log> list = logService.selectAll(params,log);
        Map<String, Object> map = new HashMap<String, Object>();
       // PageUtils pageUtils = new PageUtils(list, list.size(), Integer.parseInt(params.get("limit").toString())  ,Integer.parseInt(params.get("page").toString()));

        map.put("page",list);
        return map;
    }

    /**
     *
     * @param id
     * @return
     */
    @RequestMapping("/info/{id}")
    @ResponseBody
    //@RequiresPermissions("category:info")
    public Object info(@PathVariable("id") Integer id) {

        return null;
    }




	
}
